<div id="<?php echo $data->get('title'); ?>">
    <h2><?php echo $data->get('title'); ?></h2>
    <?php if (count($data->get('files')) > 0): ?>
    <table>
        <tr>
            <th>No.</th>
            <th>Filename</th>
            <th>Path</th>
            <th>Message</th>
            <th>Size</th>
        </tr>
        <?php $total = 0; ?>
        <?php foreach ($data->get('files') as $index=>$fileMessage): ?>
        <?php $file = $fileMessage->getFilename(); ?>
        <?php $fileParts = explode('/', $file); ?>
        <?php $total += file_exists($file) ? filesize($file) : 0; ?>
        <tr>
            <td><?php echo $index+1; ?>.</td>
            <td><?php echo array_pop($fileParts); ?></td>
            <td><?php echo implode('/', array_slice($fileParts, 0, count($fileParts))); ?></td>
            <td><?php htmlspecialchars($fileMessage); ?></td>
            <td><?php echo file_exists($file) ? \DebugComponent\Renderer\Humanize::capacity(filesize($file)) : 'unknown'; ?></td>
        </tr>
        <?php endforeach; ?>
        <tr>
            <th colspan="4">Total</th>
            <th><?php echo \DebugComponent\Renderer\Humanize::capacity($total); ?></th>
        </tr>
    </table>
    <?php endif; ?>
    
    <h3>Included files</h3>
    <table>
        <tr>
            <th>No.</th>
            <th>Filename</th>
            <th>Path</th>
            <th>Size</th>
        </tr>
    <?php $total = 0; ?>
    <?php foreach ($data->get('includedFiles') as $index=>$file): ?>
        <?php $fileParts = explode('/', $file); ?>
        <?php $total += file_exists($file) ? filesize($file) : 0; ?>
        <tr>
            <td><?php echo $index+1; ?>.</td>
            <td><?php echo array_pop($fileParts); ?></td>
            <td><?php echo implode('/', array_slice($fileParts, 0, count($fileParts))); ?></td>
            <td><?php echo file_exists($file) ? \DebugComponent\Renderer\Humanize::capacity(filesize($file)) : 'unknown'; ?></td>
        </tr>
    <?php endforeach; ?>
        <tr>
            <th colspan="3">Total</th>
            <th><?php echo \DebugComponent\Renderer\Humanize::capacity($total); ?></th>
        </tr>
    </table>
</div>